package personal.dao.accounting;

import java.util.List;

import personal.domain.accounting.IncomeExpenseCategory;
import personal.domain.accounting.MonthlyCategoryTotal;
import personal.domain.accounting.MonthwiseCalendar;


public interface IncomeExpenseDAO {
	/**
	 * Returns all income expense categories from database.
	 * @return List<IncomeExpenseCategory>. List of income expense categories
	 */
	public List<IncomeExpenseCategory> getAllIncomeExpenseCategories();
	/**
	 * Saves (insert or update) an income expense category.
	 * @param ieCategory. IncomeExpenseCategory to be saved.
	 * @return IncomeExpenseCategory with generated category id (for insert).
	 */
	public IncomeExpenseCategory saveIncomeExpenseCategory(IncomeExpenseCategory ieCategory);
	/**
	 * Saves income expense category total for a month.
	 * @param mcTotal. MonthlyCategoryTotal
	 */
	public void saveMonthlyCategoryTotal(MonthlyCategoryTotal mcTotal);
	/**
	 * Adjusts category total for a month with the provided amount.
	 * @param mcTotal. Provide signed diffential amount to be adjusted in MonthlyCategoryTotal.total 
	 * @return. int - number of records adjusted
	 */
	public int adjustMonthlyCategoryTotal(MonthlyCategoryTotal mcTotal);
	/**
	 * Finds monthly category totals across all categories for a given year or month
	 * @param calendar. MonthwiseCalendar. Provide either year or both year and month to search
	 * @return List<MonthlyCategoryTotal>
	 */
	public List<MonthlyCategoryTotal> getMonthlyCategoryTotalsForCalendar(MonthwiseCalendar calendar);
}
